package DataLayer;

import org.jfree.data.general.PieDataset;
import org.jfree.data.jdbc.JDBCPieDataset;

public class DaoAccountPieChart extends DaoConnection{
	private static DaoAccountPieChart single;
	
	public PieDataset getPieSet(){
		JDBCPieDataset dataset = null;
		try {
			openConn();
			dataset = new JDBCPieDataset(getConn());
			String sql = ("SELECT name, balance from Account");
			
			
			dataset.executeQuery(sql);	
			closeconn();
			
			
		} catch (Exception e) {
			e.printStackTrace();
		}
		return dataset;
	}
	public static DaoAccountPieChart getInstance(){
		if(single == null){
			single = new DaoAccountPieChart();
		}
		return single;
	}
	
	public static void selfDestroy(){
		single = null;
	}
	
	

}